<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/24 0024
 * Time: 下午 13:44
 */


header("content-type:text/html;charset=utf-8");
//得到查询的菜单
include ("./weChat.inc.php");
define("APPID","wxf7b9092279b1e3a8");
define("APPSECRET","8db0fce10ad12adb5ce15346eb3e9eb5");
define("TOKEN","WeiXin");

/*********** 创建的菜单名称 ***************/
$menu = '{

    "button": [
        {
          "type":"click",
          "name":"新闻头条",
          "key":"news"
        },

        {
            "name": "游戏",
            "sub_button": [
                {
                     "type": "view",
                        "name": "忍者大师",
                        "url": "http://m.7724.com/rzds/game",
                        "sub_button": [ ]
                }
            ]
        },
        {
            "name": "菜单",
            "sub_button": [
                {
                    "type": "view",
                    "name": "视频",
                    "url": "http://v.qq.com/",
                    "sub_button": [ ]
                },
                {
                    "type": "view",
                    "name": "段子",
                    "url": "http://neihanshequ.com/",
                    "sub_button": [ ]
                },
                {
                    "type": "view",
                    "name": "搜索",
                    "url": "http://www.baidu.com/",
                    "sub_button": [ ]
                }
            ]
        }
    ]
}';
$Wechat = new WeChat(APPID,APPSECRET,TOKEN);
$Wechat->_createMenu($menu);